<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绝对定位与居中对齐示例</title>
</head>
<style>
    body {
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        background: linear-gradient(135deg, #f0f0f0, #b3d9ff);
    }

    .A {
        position: relative;
        background: linear-gradient(to right, 
                #ff7e5f, 
                #feb47b);
        width: 500px;
        height: 500px;
    }

    .B {
        position: absolute;
        background: linear-gradient(135deg, #36d1dc, #5b86e5);
        width: 250px;
        height: 250px;
        left: 125px;
        top: 125px;
        text-align: center;
    }
</style>

<body>
    <div class="A">
        <div class="B">在其父级容器中水平、垂直居中的绝对定位的DIV</div>
    </div>
</body>

</html>